{% load bootstrap3 %}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	
    <title>二七君的图书馆</title>

    {% bootstrap_css %}
    {% bootstrap_javascript %}

</head>
<body>
{##}
{#    <nav class="navbar navbar-default navbar-static-top">#}
{#        <div class="container">#}
{#            #}
{#            <div class="navbar-header">#}
{#                <button type="button" class="navbar-toggle collapsed"#}
{#                    data-toggle="collapse" data-target="#navbar"#}
{#                    aria-expanded="false" aria-controls="navbar"></button>#}
{#            </div>#}
{#            <a class="navbar-brand" href="/libraries">主页</a>#}
{#            <a class="navbar-brand" href="books">借阅</a>#}
{#            <a class="navbar-brand" href="books_returns">归还</a>#}
{#        </div>#}
{##}
{#        <div id="navbar" class="navbar-collapse collapse">#}
{#            <ul class="nav navbar-nav">#}
{#                <li><a class="navbar-brand" href="new_books">添加新书籍</a></li>#}
{#            </ul>#}
{#        </div>#}
{#    </nav>#}
{##}
{#    <table align="center">#}
{#        <tr>#}
{#            <td align="center">#}
{#                书名#}
{#            </td>#}
{#            <td align="center">#}
{#                类型#}
{#            </td>#}
{#            <td align="center">#}
{#                外借次数#}
{#            </td>#}
{#            <td align="center">#}
{#                状态#}
{#            </td>#}
{#            <td>#}
{#                存放地址#}
{#            </td>#}
{#        </tr>#}
{#            {% for book in books %}#}
{#        <tr>#}
{#            <td align="center">#}
{#                {{ book.name }}#}
{#            </td>#}
{#            <td align="center">#}
{#                {{ book.book_type }}#}
{#            </td>#}
{#            <td align="center">#}
{#                {{ book.times }}#}
{#            </td>#}
{#            {% if book.state == False %}#}
{#            <td align="center">#}
{#                存库#}
{#            </td>#}
{#            {% else %}#}
{#            <td align="center">#}
{#                外借#}
{#            </td>#}
{#            {% endif %}#}
{#            <td>#}
{#                {{ book.stock_position }}#}
{#            </td>#}
{#        </tr>#}
{#        {% endfor %}#}
{#    </table>#}
{#    <table border='1'>#}
{#        <tr>#}
{#            <td colspan="3">#}
{#                借还记录#}
{#            </td>#}
{#        </tr>#}
{#        <tr>#}
{#            <td>#}
{#                书名#}
{#            </td>#}
{#            <td>#}
{#                状态#}
{#            </td>#}
{#            <td>#}
{#                时间#}
{#            </td>#}
{#        </tr>#}
{#        {% for br_record in br_records %}#}
{#        <tr>#}
{#            <td>#}
{#                {{ br_record.name.name }}#}
{#            </td>#}
{#            <td>#}
{#                {{ br_record.state }}#}
{#            </td>#}
{#            <td>#}
{#                {{ br_record.outs_ins }}#}
{#            </td>#}
{#        </tr>#}
{#        {% endfor %}#}
{#    </table>#}
{#	<style type="text/css">#}
{#        table#}
{#        {#}
{#            text-align: center;#}
{#        }#}
{#        ul #}
{#        {#}
{#            list-style-type: none;#}
{#            margin: 0;#}
{#            padding: 0;#}
{#            width: 200px;#}
{#            background-color: #bc77f1;#}
{#        }#}
{##}
{#        li a #}
{#        {#}
{#            display: block;#}
{#            color: #a4466c;#}
{#            padding: 8px 16px;#}
{#            text-decoration: none;#}
{#        }#}
{##}
{#        li a.active #}
{#        {#}
{#            background-color: #4CAF50;#}
{#            color: white;#}
{#        }#}
{##}
{#        li a:hover:not(.active) #}
{#        {#}
{#            background-color: #555;#}
{#            color: white;#}
{#        }#}
{#        body#}
{#        {#}
{#            /*background-color: #66ccff;*/#}
{#        }#}
{#	</style>#}
    <nav class="navbar navbar-default navbar-static-top">
        <form class="navbar-form navbar-left" role="search">
            <div class="form-group">
                <input type="text" class="form-control" placeholder="查找书籍">
            </div>
            <button type="submit" class="btn btn-default">检索</button>
        </form>
        <div class="container">
            <ul class="nav nav-pills">
                <li role="presentation"><a href="/libraries">主页</a></li>
                <li role="presentation"><a href="/libraries/books">借阅</a></li>
                <li role="presentation"><a href="/libraries/books_returns">归还</a></li>
            </ul>
        </div>
    </nav>
{% block content %}
    <ul class="container">
        <div class="list-group">
            <div class="list-group-item row">
                <span class="col-sm-1 text-center">序号</span>
                <span class="col-sm-3 text-center">书名</span>
                <span class="col-sm-2 text-center">状态</span>
                <span class="col-sm-2 text-center">类型</span>
                <span class="col-sm-2 text-center">书架</span>
                <span class="col-sm-2 text-center">操作</span>
            </div>
            {% for book in books %}
            <div class="list-group-item row">
                <span class="col-sm-1 text-center">
                    {{ book.numbers }}
                </span>
                <span class="col-sm-3 text-center">
                    {{ book.name }}
                </span>
                <span class="col-sm-2 text-center">
                    {{ book.get_state_display }}
                </span>
                <span class="col-sm-2 text-center">
                    {{ book.book_type }}
                </span>
                <span class="col-sm-2 text-center">
                    {{ book.stock_position }}
                </span>
                <span class="col-sm-2 text-center">
                    <a href="{% url 'libraries:detail' book.id %}">
                        <button type="submit" class="btn btn-default">跳转</button>
                    </a>
                </span>
            </div>
            {% endfor %}
        </div>
    </ul>
{% endblock content %}
</body>
<style>
    ul.container {
        width: 800px;
        {#height: 400px;#}
    }
</style>
</html>